home *** CD-ROM | disk | FTP | other *** search
- /* circle.c */
- /* Entered by A. Wayner */
- # include <graphics.h>
- main()
- {
- int graphdriver = DETECT;
- int graphmode, xc, yc, radius;
- char buffer[80];
-
- /* Ask user for parameters of the circle */
- printf("Enter coordinates of center (x, y): ");
- scanf(" %d %d", &xc, &yc );
- printf("\nRadius : ");
- scanf(" %d", &radius);
-
- /* Detect adapter type and */
- /* initialize graphics system */
- initgraph( &graphdriver, &graphmode, "\\turboc");
-
- sprintf( buffer, "circle (%d, %d, %d)",
- xc, yc, radius );
- outtextxy( 10, 10, buffer);
-
- /* Now draw the circle */
- circle( xc, yc, radius );
-
- /* Wait until user presses a key */
- outtextxy( 10, getmaxy() - 50, "Press any key to exit");
-
- getch();
- closegraph();
-
- }
-